﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" validateRequest="false"
    CodeBehind="CompanyConfig.aspx.cs" Inherits="NetDon.OA.Portal.Admin.CompanyConfig" %>

<%@ Import Namespace="NetDon.OA.Portal.Constants" %>
<%@ Register Assembly="NineRays.WebControls.FlyTreeView" Namespace="NineRays.WebControls"
    TagPrefix="NineRays" %>
<%@ Register TagPrefix="uc2" TagName="RequiredMark" Src="~/Controls/RequiredMark.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" type="text/javascript">
        function SelectedNodeChanged() {
            $get('<%=btnModify.ClientID %>').click();
        }
        function pageCommand(args) {
            if (args.get_commandName() == '<%=ButtonConstants.CommandNames.Delete %>') {
                if (!args.get_commandArgument()) {
                    $confirm('确认删除该公司吗？', function (result) {
                        if (result) {
                            __doCommand('<%=ButtonConstants.CommandNames.Delete %>', treeview.getSelectedNode().getValue(), false, '');
                        }
                    });
                    args.set_cancel(true);
                }
            }
        }
        var treeview;
        function flyTreeView_onInitialized(treeviewObject) {
            treeview = treeviewObject;
        }
                         
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate> </ContentTemplate>
    </asp:UpdatePanel>--%>
    <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td valign="top">
                <NineRays:FlyTreeView ID="treeCompany" Width="280px" runat="server"
                    DrawLines="true" ContentClickExpands="false" OnPopulateNodes="treeCompany_PopulateNodes"
                    OnInitializedJavascript="flyTreeView_onInitialized" OnSelectedNodeChangedJavascript="SelectedNodeChanged">
                </NineRays:FlyTreeView>
            </td>
            <td valign="top">
                <NetDon:FormPanel ID="pnlCompanyInfo" runat="server" RepeatColumns="2" Visible="false">
                    <Items>
                        <NetDon:FormItem HeaderText="父公司" ColumnSpan="2">
                            <ContentTemplate>
                                <asp:TextBox ID="txtParentName" BackColor="LightSkyBlue" ReadOnly="true" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtParentName"
                                    Display="None" ErrorMessage="请输入父公司名称" SetFocusOnError="True"></asp:RequiredFieldValidator>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="公司编号">
                            <ContentTemplate>
                                <asp:TextBox ID="txtCompanyCode" runat="server" MaxLength="50" Width="120px"></asp:TextBox>
                                <uc2:RequiredMark ID="RequiredMark1" runat="server" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtCompanyCode"
                                    Display="None" ErrorMessage="请输入公司编号" SetFocusOnError="True"></asp:RequiredFieldValidator>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="公司名称">
                            <ContentTemplate>
                                <asp:TextBox ID="txtCompanyName" runat="server" MaxLength="254"></asp:TextBox>
                                <uc2:RequiredMark ID="RequiredMark2" runat="server" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCompanyName"
                                    Display="None" ErrorMessage="请输入公司名称" SetFocusOnError="True"></asp:RequiredFieldValidator>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="董事长">
                            <ContentTemplate>
                                 <asp:TextBox ID="txtPresident" runat="server" MaxLength="50"></asp:TextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="邮编">
                            <ContentTemplate>
                                <asp:TextBox ID="txtPostalCode" runat="server" MaxLength="50"></asp:TextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="传真">
                            <ContentTemplate>
                                <asp:TextBox ID="txtFax" runat="server" MaxLength="50"></asp:TextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="电话">
                            <ContentTemplate>
                                <asp:TextBox ID="txtPhone" runat="server" MaxLength="50"></asp:TextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="Email" ColumnSpan="2">
                            <ContentTemplate>
                                <asp:TextBox ID="txtEmail" runat="server" MaxLength="50"></asp:TextBox><asp:RegularExpressionValidator
                                    ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEmail"
                                    Display="None" SetFocusOnError="True" ErrorMessage="please input correct email format"
                                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="网站地址" ColumnSpan="2" >
                            <ContentTemplate>
                                <asp:TextBox ID="txtWebsite" Width="450px" runat="server" MaxLength="50"></asp:TextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="地址" ColumnSpan="2">
                            <ContentTemplate>
                                <asp:TextBox ID="txtAddress" runat="server" Wrap="true" Width="450px"></asp:TextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="描述" FullRow="True">
                            <ContentTemplate>
                                <asp:TextBox ID="txtCompanyNodeLevel" runat="server" Visible="false"></asp:TextBox>
                                <FTB:FreeTextBox ID="txtDescription" runat="server" Height="250px" Width="540px">
                                </FTB:FreeTextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                    </Items>
                </NetDon:FormPanel>
                <NetDon:FormPanel ID="pnlDepartmentInfo" runat="server" RepeatColumns="2" Visible="false">
                    <Items>
                        <NetDon:FormItem HeaderText="父公司或父部门" ColumnSpan="2">
                            <ContentTemplate>
                                <asp:TextBox ID="txtParentCompanyOrDepartmentName" BackColor="LightSkyBlue" ReadOnly="true"
                                    runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtParentCompanyOrDepartmentName"
                                    Display="None" ErrorMessage="请输入父公司名称" SetFocusOnError="True"></asp:RequiredFieldValidator>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="部门编号">
                            <ContentTemplate>
                                <asp:TextBox ID="txtDepartmentCode" runat="server" MaxLength="50" Width="120px"></asp:TextBox>
                                <uc2:RequiredMark ID="RequiredMark3" runat="server" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtDepartmentCode"
                                    Display="None" ErrorMessage="请输入部门编号" SetFocusOnError="True"></asp:RequiredFieldValidator>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="部门名称">
                            <ContentTemplate>
                                <asp:TextBox ID="txtDepartmentName" runat="server" MaxLength="256"></asp:TextBox>
                                <uc2:RequiredMark ID="RequiredMark4" runat="server" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtDepartmentName"
                                    Display="None" ErrorMessage="请输入部门名称" SetFocusOnError="True"></asp:RequiredFieldValidator>
                            </ContentTemplate>
                        </NetDon:FormItem>
                         <NetDon:FormItem HeaderText="部门经理">
                            <ContentTemplate>
                                 <asp:TextBox ID="txtDepartManager" runat="server" MaxLength="50"></asp:TextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="传真">
                            <ContentTemplate>
                                <asp:TextBox ID="txtDepartFax" runat="server" MaxLength="50"></asp:TextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="电话" ColumnSpan="2">
                            <ContentTemplate>
                                <asp:TextBox ID="txtDepartTelephone" runat="server" MaxLength="50"></asp:TextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="地址" ColumnSpan="2">
                            <ContentTemplate>
                                <asp:TextBox ID="txtDepartAddress" MaxLength="254" runat="server" Width="450px"></asp:TextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="描述" FullRow="True">
                            <ContentTemplate>
                                <asp:TextBox ID="txtDepartmentNodeLevel" runat="server" Visible="false"></asp:TextBox>
                                <FTB:FreeTextBox ID="txtDepartDesc" runat="server" Height="250px" Width="540px">
                                </FTB:FreeTextBox>
                            </ContentTemplate>
                        </NetDon:FormItem>
                    </Items>
                </NetDon:FormPanel>
            </td>
        </tr>
    </table>
    <div style="margin-top: 10px; text-align: center">
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="List"
            ShowMessageBox="True" ShowSummary="False" />
    </div>
    <asp:Button ID="btnModify" runat="server" OnClick="btnModify_Click" Style="display: none"
        CausesValidation="False" />
</asp:Content>
